{extend name="public/base" /}
    {block name="content"}
          
<section class="content-header">
<h1>
           系统概要
<small>Optional description</small>
</h1>
<ol class="breadcrumb">
	<li><a href="{:U('Index/index')}"><i class="fa fa-dashboard"></i> 首页</a></li>
</ol>
</section>
<!-- Main content -->
<section class="content">

              <!-- 快捷方式  -->
              <div class="box box-solid bg-teal-gradient" >
                <div class="box-header">
                  <i class="fa fa-th"></i>
                  <h3 class="box-title" style="color:#000;">快捷方式</h3>
                  <div class="box-tools pull-right">
                    <button class="btn bg-teal btn-sm" data-widget="collapse"><i class="fa fa-minus"></i></button>
                    <!-- <button class="btn bg-teal btn-sm" data-widget="remove"><i class="fa fa-times"></i></button> -->
                  </div>
                </div>
                <div class="box-body border-radius-none">
                  <div class="chart" id="line-chart" style="height: 150px;color:#000;">

				                <!-- small box -->
           <style>
		   a{ color:#fff; text-decoration:none;}
		   .inner p {padding:2px 0 0 5px;}
		   .inner h4 {font-size:24px;padding:10px 0 0 5px;}
		   </style>
			<div class="col-lg-3 col-xs-6">
			<a href="{:U('Content/addSliderContent')}">
              <div class="small-box bg-green">
                <div class="inner">
                  <h4 >内容发布</h4>
                  <p>Content Publishing</p>
                </div>
                <div class="icon">
                 <i class="ion ion-person-add"></i>
                </div>
                <a href="#" class="small-box-footer">ENTER <i class="fa fa-arrow-circle-right"></i></a>
              </div>
			  </a>
            </div>
			
			<div class="col-lg-3 col-xs-6" >
			<a href="{:U('Content/listindex')}">
              <div class="small-box bg-green">
                <div class="inner">
                  <h4 >内容管理</h4>
                  <p>Content management</p>
                </div>
                <div class="icon" >
                 <i class="ion ion-pie-graph"></i>
                </div>
                <a href="#" class="small-box-footer">ENTER <i class="fa fa-arrow-circle-right"></i></a>
              </div>
			  </a>
            </div>
			
		<div class="col-lg-3 col-xs-6">
			<a href="{:U('Term/index')}">
              <div class="small-box bg-green">
                <div class="inner">
                  <h4 >栏目管理</h4>
                  <p>Column management</p>
                </div>
                <div class="icon">
                  <i class="ion ion-stats-bars"></i>
                </div>
                <a href="#" class="small-box-footer">ENTER<i class="fa fa-arrow-circle-right"></i></a>
              </div>
			  </a>
            </div>
			
			<div class="col-lg-3 col-xs-6">
			<a href="{:U('Links/index')}">
              <div class="small-box bg-green">
                <div class="inner">
                  <h4 >链接管理</h4>
                  <p> Manage Links</p>
                </div>
                <div class="icon">
                 <i class="fa fa-fw fa-bars"></i>
                </div>
                <a href="#" class="small-box-footer">ENTER<i class="fa fa-arrow-circle-right"></i></a>
              </div>
			  </a>
            </div>
			 <!-- small box end -->
				  
				  </div>
                </div>
              </div>
              <!-- 快捷方式 END -->



			    <div class="box box-solid bg-teal-gradient" >
                <div class="box-header">
                  <i class="fa fa-th"></i>
				   <h3 class="box-title" style="color:#000;">浏览量统计</h3>
                  <div class="box-tools pull-right">
                    <button class="btn bg-teal btn-sm" data-widget="collapse"><i class="fa fa-minus"></i></button>
                  </div>
                </div>
                <div class="box-body border-radius-none">
			    <div class="row">
					  <!-- 访问量统计 -->
                   <div class="col-md-8">
					  <div class="box box-primary">
					  	<div class="box-header with-border">
						  <h3 class="box-title">近8小时流量趋势</h3>
						<div style="border:1px solid rgba(60,141,188,0.8);width:50px;float:right;margin:10px 0 0 10px;">
						 <!-- PV  -->
						</div>
						<span style="float:right;margin-left:10px;">PV:</span>
						<div style="border:1px solid rgba(90,11,188,0.8);width:50px;float:right;margin:10px 0 0 10px;">
						<!-- IP -->
						</div>
						<span style="float:right;margin-left:10px;">IP:</span>
						<div style="border:1px solid rgba(190,101,18,0.8);width:50px;float:right;margin:10px 0 0 10px;">
						<!-- 独立访客 -->
						</div>
						<span style="float:right;margin-left:10px;">独立访客:</span>
						</div>
						<div class="box-body">
						  <div class="chart">
							<canvas id="areaChart" style="height:250px"></canvas>
						  </div>
						</div>
					  </div>
					</div>
			     <!-- 访问量统计 END-->				
				<!-- 图表 -->
                   <div class="col-md-4">
					  <div class="box box-primary">
						<div class="box-body">
						  <div class="chart" style="color:#000">
						  
				<table class="table table-hover table-striped" >
                <tbody >
                <tr>
                    <td>日期</td>
                    <td>PV/次</td>
                    <td>IP/个</td>
                    <td style="width:100px;">独立访客/个</td>
                </tr>
			
			
                <tr>
                    <td>今天</td>
                    <td style="color:rgba(60,141,188,1)">{$sum0}</td>
                    <td style="color:rgba(90,11,188,1)">{$day_ip0}</td>
                    <td style="width:80px;color:rgba(190,101,18,1);text-align:center">{$dulifangke0}</td>
                </tr>
				
                <tr>
                    <td>昨天</td>
                    <td style="color:rgba(60,141,188,1)">{$sum1}</td>
                    <td style="color:rgba(90,11,188,1)">{$day_ip1}</td>
                    <td style="width:80px;color:rgba(190,101,18,1);text-align:center">{$dulifangke1}</td>
                </tr>
                <tr>
                    <td>{:date('Y-m-d',time()-2*86400)}</td>
                    <td style="color:rgba(60,141,188,1)">{$sum2}</td>
                    <td style="color:rgba(90,11,188,1)">{$day_ip2}</td>
                    <td style="width:80px;color:rgba(190,101,18,1);text-align:center">{$dulifangke2}</td>
                </tr>
                <tr>
                    <td>{:date('Y-m-d',time()-3*86400)}</td>
                    <td style="color:rgba(60,141,188,1)">{$sum3}</td>
                    <td style="color:rgba(90,11,188,1)">{$day_ip3}</td>
                    <td style="width:80px;color:rgba(190,101,18,1);text-align:center">{$dulifangke3}</td>
                </tr>				
                </tbody>
            </table>
					
						
						  </div>
						</div>
					  </div>
					</div>
			     <!-- 图表 END-->	
				</div>


                </div>
              </div>
			  <!-- 访问来源 -->
			  			    <div class="box box-solid bg-teal-gradient" >
                <div class="box-header">
                  <i class="fa fa-th"></i>
				   <h3 class="box-title" style="color:#000;">访问来源</h3>
                  <div class="box-tools pull-right">
                    <button class="btn bg-teal btn-sm" data-widget="collapse"><i class="fa fa-minus"></i></button>
                  </div>
                </div>
                <div class="box-body border-radius-none">
			    <div class="row">
					 <!-- 访问来源 -->
                    <div class="col-md-9">
					  <div class="box box-info">
						<div class="box-body">
						  <div class="chart">
							<canvas id="lineChart" style="height:250px"></canvas>
						  </div>
						</div>
					  </div>
					</div>	
                   <!-- 访问来源 END-->	
				<!-- 图表 -->
                   <div class="col-md-3">
					  <div class="box box-info">
						<div class="box-body" style="color:#000;overflow-y:scroll;height:280px;">
						  <div class="chart" >
						  
			<table class="table table-hover table-striped" >
                <tbody >
                <tr>
                    <td>来源</td>
                    <td style="width:70px;">次数/次</td>
                </tr>
				{volist name="num" key="k" id="data"}
                <tr>
                    <td>{$key}</td>
                    <td class="mailbox-star" style="text-align:center;">{$data}</td>
                
                </tr>
				
                {/volist}
				
                </tbody>
            </table>
				</div>
						</div>
					  </div>
					</div>
			     <!-- 图表 END-->				   
				
				</div>


                </div>
              </div>
			  
			  
			  <!-- 访问来源 END-->
			  
			  
<!-- 			<div class="box box-solid bg-teal-gradient" >
                <div class="box-header">
                  <i class="fa fa-th"></i>
                  <div class="box-tools pull-right">
                    <button class="btn bg-teal btn-sm" data-widget="collapse"><i class="fa fa-minus"></i></button>
                  </div>
                </div>
                <div class="box-body border-radius-none">
			    <div class="row">
					 
                   <div class="col-md-6">
					  <div class="box box-primary">
						<div class="box-header with-border">
						  <h3 class="box-title">官方公告</h3>
						  <div class="box-tools pull-right">
							<button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
							<button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
						  </div>
						</div>
						<div class="box-body">
						  <div class="chart" id="wanhucms_news">
							
						  </div>
						</div>
					  </div>
					</div>
			    				
				</div>
                </div>
            </div> -->
			  
<!-- 	<script type="text/javascript">
	function getLocalTime(nS) {     
	    return new Date(parseInt(nS) * 1000).toLocaleDateString().replace(/[\/]/g,'-');     
	}
    
	$.ajax({  
	  type:"post",
	  async:false,	  
	  url:"http://www.wanhunet.com/index.php/Index/wanhucms/",
	  dataType: "jsonp",
	  jsonp: "callback",
	  jsonpCallback:"flightHandler",
	  success:
	  function(data){
		if(data==null){
			$("#wanhucms_news").html('<li><a href="" style="color:#FF0000;display:inline-block"><p>无最新消息[2016-02-29]</p></a></li>');
			$("#wanhucms_news").addClass("rq-fyxxtext");
			$(".pages").hide();
		}else{
			
			 for(var i=0;i<data.length;i++){
				html='<li><a href="" style="color:#000;display:inline-block"><p>['+getLocalTime(data[i].create_time)+']&nbsp;'+data[i].title+'</p></a></li>';
				$("#wanhucms_news").append(html); 
			}
		}
	  },
	      error:function(a,b,c){  
            alert(a+"++"+b+"++"+c);  
        }  
});
</script> -->

	  <script>
      $(function () {
        var areaChartCanvas = $("#areaChart").get(0).getContext("2d");
        var areaChart = new Chart(areaChartCanvas);
        var areaChartData = {
          labels: [{$time}],
          datasets: [
            {
              label: "本月访问量",
              fillColor: "rgba(0,0,0,0)", //60,141,188,0.9 PV
              strokeColor: "rgba(60,141,188,0.8)",
              pointColor: "rgba(60,141,188,1)",
              pointStrokeColor: "rgba(60,141,188,1)",
              pointHighlightFill: "rgba(60,141,188,1)",
              pointHighlightStroke: "rgba(60,141,188,1)",
              data: [{$num_pv}]
            },{
              label: "IP",
              fillColor: "rgba(0,0,0,0)", //60,141,188,0.9 IP
              strokeColor: "rgba(90,11,188,0.8)",
              pointColor: "rgba(90,11,188,0.8)",
              pointStrokeColor: "rgba(90,11,188,0.8)",
              pointHighlightFill: "rgba(90,11,188,0.8)",
              pointHighlightStroke: "rgba(90,11,188,0.8)",
              data: [{$num_ip}]
            },{
              label: "独立访客",
              fillColor: "rgba(0,0,0,0)", //60,141,188,0.9 独立访客
              strokeColor: "rgba(190,101,18,0.8)",
              pointColor: "rgba(190,101,18,0.8)",
              pointStrokeColor: "rgba(190,101,18,0.8)",
              pointHighlightFill: "rgba(190,101,18,0.8)",
              pointHighlightStroke: "rgba(190,101,18,0.8)",
              data: [{$du_ip}]
            }
          ]
        };

        var areaChartOptions = {
          showScale: true,
          scaleShowGridLines: false,
          scaleGridLineColor: "rgba(0,0,0,.05)",
          scaleGridLineWidth: 1,
          scaleShowHorizontalLines: true,
          scaleShowVerticalLines: true,
          bezierCurve: true,
          bezierCurveTension: 0.5,
          pointDot: false,
          pointDotRadius: 4,
          pointDotStrokeWidth: 1,
          pointHitDetectionRadius: 20,
          datasetStroke: true,
          datasetStrokeWidth: 2,
          datasetFill: true,
          maintainAspectRatio: true,
          responsive: true
        };
        areaChart.Line(areaChartData, areaChartOptions);

        //-------------
        //- LINE CHART -
        //--------------
		
		
		//饼图
        var pieChartCanvas = $("#lineChart").get(0).getContext("2d");
        var pieChart = new Chart(pieChartCanvas);
        var PieData = [
		{volist name="num" key="k" id="data"}
          {
            value:"{$data}",
            color: "{$color[$k-1]}",
            highlight: "{$color[$k-1]}",
            label: "{$key}"
          },
		 {/volist}
		  
          
        ];
        var pieOptions = {
          segmentShowStroke: true,
          segmentStrokeColor: "#fff",
          segmentStrokeWidth: 2,
          percentageInnerCutout: 50,
          animationSteps: 100,
          animationEasing: "easeOutBounce",
          animateRotate: true,
          animateScale: false,
          responsive: true,
          maintainAspectRatio: true,
        };
        pieChart.Doughnut(PieData, pieOptions);
		
		
       //结束符号
      });

    </script>
</section>
    {/block}
